<%@page import="models.Domain"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="controller.Utils"%>
<%
String strs = (String) request.getAttribute("strs");
String name = (String) request.getAttribute("name");
Domain domain = (Domain) request.getAttribute("domain");
	
Date date = new Date();
Date dates = new Date();
if(domain.getDate() != null)
{
	dates = domain.getDate();
}
long seconds = (date.getTime() - dates.getTime())/1000;
long day = (int) (seconds / 86400);
long hour = (int) ((seconds - day*86400) / 3600);
long minute = (int) ((seconds - day*86400 - hour*3600) / 60);


NumberFormat nf = NumberFormat.getInstance();
String title = domain.getDomain();
String description = domain.getDomain()+".BestReviewWebsite - best review and free analytic for webmasters that gathers detailed information on your website : traffic details, Technology language, whois, ranking info, Website backlinks,website IP, DNS record, optimization, network tools, seo tools...don’t install and very easy, review to directly use our services for your website";
String keyword = "";

title = (domain.getTitle()!=null)?Utils.returnDomain(domain.getDomain())+" "+domain.getDomain()+" "+domain.getTitle():Utils.returnDomain(domain.getDomain())+" "+domain.getDomain();

if(domain.getKeywords()!=null)
{
	keyword += domain.getKeywords().getValue();
}
if(domain.getPopularKeyword()!=null)
{
	keyword += domain.getPopularKeyword().getValue();
}
if(keyword.equals(""))
{
	keyword = domain.getDomain()+",Best review websites,  Server information, review website analysis";
}

description = (domain.getDescription()!=null)?domain.getDescription().getValue():keyword+",.BestReviewWebsite - best review and free analytic for webmasters that gathers detailed information on your website : traffic details, Technology language, whois, ranking info, Website backlinks,website IP, DNS record, optimization, network tools, seo tools...don’t install and very easy, review to directly use our services for your website";
if(description.length() > 250)
{
	description = description.substring(0,250);
}

if(keyword.length() > 250)
{
	keyword = keyword.substring(0,250);
}

String names = domain.getDomain();

String dedate = (dates.getYear()+1900)+"-"+(dates.getMonth()+1)+"-"+dates.getDate();
%>
<%
	request.setCharacterEncoding("utf-8");
%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keyword %>"/>
	<jsp:param name="name" value="<%=names %>" />
	<jsp:param name="link" value="detail" />
	<jsp:param name="date" value="<%=dedate %>" />
</jsp:include>
		
		<div id="mainContent">
                <div id="leftSideContent">
                	<div id="detailPage">
                		<h1 class="title">
                			<a href="/show/<%=domain.getDomain() %>"><%=domain.getDomain() %></a>
                		</h1>
                        <p class="siteUpdated clearafter box-grey">
                        	Updated <strong>
                        	<%
								if(day > 0)
								{
									out.print(day+" days, ");
								}
								if(hour > 0)
								{
									out.print(hour+" hours, ");
								}
								out.print(minute+" minutes");
							%></strong>
                        	Ago
                            <strong class="right">
                            	<%
								if(day>=7 || domain.getDate() == null)
								{
								%>
											<a href="javascript:void(0)" rel="nofollow" id="update">Update</a>
								<%
								}
								%>
                            </strong>
                        </p>
                        <section class="siteDescription">
                        	<p><%=domain.getTitle()!=null?domain.getTitle():domain.getDomain() %></p>
                        	<p><%=domain.getDescription()!=null?domain.getDescription().getValue():"" %></p>
                        	<br/>
                        	<div><%@ include file='/adv/note.jsp'%><br/><br/></div>
                        	<p>
                        		<%=domain.getDomain() %></strong> <%=Utils.returnSubDomain(domain.getDomain()) %> ,has parerank is <strong><%=domain.getGooglepr() %></strong> ,the domain is <strong><%=Utils.checkLengthDomain(domain.getDomain()) %></strong> characters in length,
								the number of visitors to the site an average of <%=(domain.getVisit()!=null && !domain.getVisit().equals("-"))?nf.format(Math.ceil(((350*Float.parseFloat(domain.getVisit().replaceAll("[^0-9.]","")))*80)/0.03))+" - "+nf.format(Math.ceil(((350*Float.parseFloat(domain.getVisit().replaceAll("[^0-9.]","")))*120)/0.03)):"-" %>
								,the average speed of the site is   <%=(domain.getSpeed()!=null)?Float.valueOf(domain.getSpeed())+" Seconds":"-" %> .
							</p>                            
                        </section>
                        <section class="blockContent blockBlue">
                        	<h3 class="title">Ranking info</h3>
                            <ul class="infoDetail">
                            	<li class="clearafter">
                                	<div class="infoLeft">Google pagerank : </div>
                                    <div class="infoRight"><%=domain.getGooglepr()!=null?domain.getGooglepr():"-" %></div>
                                </li>
                                <li class="clearafter">
                                	<div class="infoLeft">Alexa rank : </div>
                                    <div class="infoRight"><%=nf.format(domain.getAlexa()) %></div>
                                </li>
                            </ul>
                        </section>
                        <section class="blockContent blockBlue clearafter siteInfo">
							<h3 class="title">Site info</h3>
                            <ul class="infoDetail">
                            	<li class="right">
                            		<script type="text/javascript"><!--
google_ad_client = "ca-pub-0793232849423114";
/* web20300600 */
google_ad_slot = "7904753076";
google_ad_width = 300;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
                            	</li>
                                <li class="clearafter">
                                    <div class="infoLeft">Domain : </div>
                                    <div class="infoRight">
                                    	<%
										if(domain.getDomain()!=null)
										{
										%>
											<strong>
												<%=domain.getDomain() %>
											</strong>
											<br/><strong>Length : <%=Utils.checkLengthDomain(domain.getDomain()) %></strong>
											characters
										<%
										} else {
											out.println(domain.getDomain());
										}
										%>
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">as7.org : </div>
                                    <div class="infoRight">
                                        View <a href="http://as7.org/d/<%=domain.getDomain() %>" target="_blank" rel="nofollow"><%=domain.getDomain() %></a> in as7.org
                                    </div>
                                </li>
                                
                                <li class="clearafter">
                                    <div class="infoLeft">Keywords : </div>
                                    <div class="infoRight">
                                        <%
										int jk = 0;
										if(domain.getKeywords()!=null)
										{
											String[] arrayList = domain.getKeywords().getValue().split(",");
											for(int i=0;i<arrayList.length;i++)
											{
												jk++;
										%>
												<a href="/keyword/<%=arrayList[i].trim() %>"><%=arrayList[i].trim() %></a> | 
										<%
											}
										}
										%>
										<br/>
										<strong>Length : <%=(domain.getKeywords()!=null)?Utils.returnLength(domain.getKeywords().getValue()):"0" %></strong>  characters<br/>
										<strong>Number : <%=jk %></strong>  keywords
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Popular Keywords : </div>
                                    <div class="infoRight">
                                        <%
										if(domain.getPopularKeyword()!=null)
										{
											String[] arrayList = domain.getPopularKeyword().getValue().split(",");
											for(int i=0;i<arrayList.length;i++)
											{
										%>
												<a href="/keyword/<%=arrayList[i].trim() %>"><%=arrayList[i].trim() %></a> | 
										<%
											}
										}
										%>
                                    </div>
                                </li>
                                
                                <li class="clearafter">
                                    <div class="infoLeft">Estimate Visitor per Day: </div>
                                    <div class="infoRight">
                                        <%=(domain.getVisit()!=null && !domain.getVisit().equals("-"))?nf.format(Math.ceil(((350*Float.parseFloat(domain.getVisit().replaceAll("[^0-9.]","")))*80)/0.03))+" - "+nf.format(Math.ceil(((350*Float.parseFloat(domain.getVisit().replaceAll("[^0-9.]","")))*120)/0.03)):"-" %>
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Speed site: </div>
                                    <div class="infoRight">
                                        <%=(domain.getSpeed()!=null)?Float.valueOf(domain.getSpeed().replaceAll("[^0-9.]",""))+" Seconds":"-" %>
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Domain Age: </div>
                                    <div class="infoRight">
                                        <%=(domain.getAge()!=null)?domain.getAge():"-" %>
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Charset : </div>
                                    <div class="infoRight">
                                        <%=(domain.getCharset()!=null)?domain.getCharset():"-" %>
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">WOT : </div>
                                    <div class="infoRight">
                                        <%=(domain.getWot()!=null)?domain.getWot():"-" %>
                                    </div>
                                </li>
                            </ul>
                        </section>
                        <section class="blockContent blockBlue">
                            <h3 class="title">Site contact info</h3>
                            <ul class="infoDetail">
                                <li class="clearafter">
                                    <div class="infoLeft">Google Analytic : </div>
                                    <div class="infoRight"><%=(domain.getGoogleAnalytic()!=null)?domain.getGoogleAnalytic():"-" %></div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Google Adsense : </div>
                                    <div class="infoRight"><%=(domain.getGoogleAdsense()!=null)?domain.getGoogleAdsense():"-" %></div>
                                </li>
                            </ul>
                        </section>
                        <section class="blockContent blockBlue">
                        	<h3 class="title">Site Technical info</h3>
                            <ul class="infoDetail">
                                <li class="clearafter">
                                    <div class="infoLeft">Programming Language : </div>
                                    <div class="infoRight"><%=(domain.getLanguage()!=null)?domain.getLanguage():"-" %></div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Web server : </div>
                                    <div class="infoRight"><%=(domain.getServer()!=null)?domain.getServer():"-" %></div>
                                </li>                            
                                <li class="clearafter">
                                    <div class="infoLeft">Javascript library : </div>
                                    <div class="infoRight"><%=(domain.getJavascript()!=null)?Utils.returnString(domain.getJavascript(),""):"-" %> </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">IP Address : </div>
                                    <div class="infoRight"><%=(domain.getIp()!=null)?"<a href='/ip/"+domain.getIp()+"'>"+domain.getIp()+"</a>":"-" %></div>
                                </li>
                                <li class="clearafter">
                                	<div class="contentHidden">
                                		More detail whois <a href="/whois/<%=domain.getDomain()%>"><%=domain.getDomain()%></a>
                                    	<%=(domain.getWhois()!=null)?Utils.returnWhois(domain.getWhois().getValue()):"" %>
                                    </div>
                                </li>
                            </ul>
                        </section>
                        <section class="blockContent blockBlue">
                            <h3 class="title">Site Seo</h3>
                            <ul class="infoDetail">
                                <li class="clearafter">
                                    <div class="infoLeft">Tag : </div>
                                    <div class="infoRight">
                                        <table cellpadding="0" cellspacing="0" width="100%">
                                            <thead>
                                                <tr>
                                                    <th>H1</th>
                                                    <th>H2</th>
                                                    <th>H3</th>
                                                    <th>H4</th>
                                                    <th>H5</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
													<th><%=(domain.getH1()!=0)?domain.getH1():"0" %></th>
													<th><%=(domain.getH2()!=0)?domain.getH2():"0" %></th>
													<th><%=(domain.getH3()!=0)?domain.getH3():"0" %></th>
													<th><%=(domain.getH4()!=0)?domain.getH4():"0" %></th>
													<th><%=(domain.getH5()!=0)?domain.getH5():"0" %></th>
												</tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Image : </div>
                                    <div class="infoRight">
                                        You have <strong><%=(domain.getImg()!=0)?domain.getImg():"-" %></strong> images on this website.
                                    </div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Frame : </div>
                                    <div class="infoRight"><%=(domain.getFrame()!=0)?domain.getFrame():"No" %></div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Flash : </div>
                                    <div class="infoRight">You have <strong><%=(domain.getFlash()!=0)?domain.getFlash():"No" %></strong> flash on this website.</div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Size : </div>
                                    <div class="infoRight"><%=(domain.getSize()!=null)?nf.format(Integer.parseInt(domain.getSize()))+" characters":"-" %></div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Meta Description : </div>
                                    <div class="infoRight"><%=domain.getCheckDes()!=0?"Yes":"No" %></div>
                                </li>
                                <li class="clearafter">
                                    <div class="infoLeft">Meta Keyword : </div>
                                    <div class="infoRight"><%=domain.getCheckKey()!=0?"Yes":"No" %></div>
                                </li>
                            </ul>
                        </section>
                        <section class="blockContent blockBlue">
                            <h3 class="title">Cross link</h3>
                            <%
								String[] arr=null;
								if(domain.getOutLink()!=null&&!domain.getOutLink().getValue().trim().equals(""))
								{
									arr = domain.getOutLink().getValue().split(",");
								}
							%>
                            <ul class="infoDetail">
                                <li class="clearafter">
                                    <div class="infoLeft">Out link : <a href="/link-out/<%=domain.getDomain()%>">View all</a></div>
                                    <div class="infoRight">
                                    	<%
										if(arr!=null)
										{
											for(int j=0;j<arr.length;j++)
											{
											%>
												<% if(!Utils.fomatDomain(arr[j]).trim().equals("")){ %><a href="/domain/<%=Utils.fomatDomain(arr[j]) %>" rel="nofollow"><%=Utils.fomatDomain(arr[j]) %></a> | <% } %>
											<%
											}
										}
										%>
                                    </div>
                                </li>
                            </ul>
                        </section>
                        <section class="blockContent blockBlue" id="domainTraffic">
                        	<h3 class="title">Domain Traffic Graph</h3>
                            <div class="clearafter graph">
                                <div class="left">
                                    <p><strong>Daily Rank</strong></p>
                                    <img alt="Daily Rank <%=domain.getDomain() %>" src="http://traffic.alexa.com/graph?c=1&amp;u=<%=domain.getDomain() %>&amp;r=6m&amp;y=t&amp;z=3&amp;h=200&amp;w=280&amp;b=FFFFFF"/>
                                </div>
                                <div class="right">
                                    <p><strong>Daily PageViews</strong></p>
                                    <img alt="Daily PageViews <%=domain.getDomain() %>" src="http://traffic.alexa.com/graph?c=1&amp;u=<%=domain.getDomain() %>&amp;r=6m&amp;y=r&amp;z=3&amp;h=200&amp;w=280&amp;b=FFFFFF" />
                                </div>
                            </div>
                            <div class="clearafter graph">
                                <div class="left">
                                    <p><strong>Unique Visitors</strong></p>
                                    <img alt="Unique Visitors <%=domain.getDomain() %>" src="http://grapher.compete.com/<%=domain.getDomain() %>_uv_310.png">
                                </div>
                                <div class="right">
                                    <p><strong>Magestic Backlinks</strong></p>
                                    <img alt="Magestic Backlinks aro-schatzkammer.de" src="http://www.majesticseo.com/charts/backlinks-discovery/<%=domain.getDomain() %>?w=290&amp;h=170&amp;IndexDataSource=F">
                                </div>
                            </div>
                        </section>
                    </div>
                </div>
                <aside id="rightSideContent">
                	<div><%@ include file='/adv/right.jsp'%></div>
                	
                	<div class="simpleBox box-blue">
                    	<ul id="sideMenu">
                        	<li><a href="/">Home</a></li>
                            <li><a href="/whois">Whois</a></li>
                            <li><a href="http://www.prapi.net" rel="nofollow">Pagerank</a></li>
                            <li><a href="/myip">Myip</a></li>
                            <li><a href="/contact">Contact us</a></li>
                        </ul>
                    </div>
                	
                    <div class="simpleBox box-blue">
                    	<h3 class="title">Other sites</h3>
                    	<ul class="domainListing">
                    		<%
							String[] oth = domain.getOtherDomain().split(",");
							for(int i=0;i<oth.length;i++)
							{
							%>
								<li><a href="/domain/<%=oth[i]%>"><%=oth[i]%></a></li>
							<%
								}	
							%>
                        </ul>
                    </div>
                    <div class="simpleBox box-grey">
                    	<h3 class="title">Featured site</h3>
                        <ul class="featuredSiteListing">
							<li><a target="_blank" rel="nofollow" href="http://www.questiondb.com/"><img src="/images/faq.png"></a></li>
                            <li><a target="_blank" rel="nofollow" href="http://prapi.net/"><img src="/images/prapi.png"></a></li>
                            <li><a target="_blank" rel="nofollow" href="http://www.yooarticles.net/"><img src="/images/yoo.png"></a></li>
                        </ul>
                    </div>
                </aside>
                <div class="clearbreak"></div>
            </div>
		
		
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
		<script type="text/javascript"src="/js/detail.js"></script>		
		<script type="text/javascript">
			var domain = '<%=domain.getDomain()%>';
		</script>
		<div id='opacity'></div>
<img src="/images/ajax-loader.gif" id='image_loadder'/>
<%@ include file='/layout/footer.jsp'%>